---
sidebar_class_name: hidden
---

import CodeBlock from "@theme/CodeBlock";
import TimeoutExample from "@examples/agents/agent_timeout.ts";

# Timeouts for agents

By default, LangChain will wait indefinitely for a response from the model provider. If you want to add a timeout to an agent, you can pass a `timeout` option, when you run the agent. For example:

import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";

<IntegrationInstallTooltip></IntegrationInstallTooltip>

```bash npm2yarn
npm install @langchain/openai
```

<CodeBlock language="typescript">{TimeoutExample}</CodeBlock>
